<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>招聘发起申请单</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/icon.css">
<link rel="stylesheet" href="static/easyui/themes/metro-red/easyui.css">
</head>
<body>
<style type="text/css">
ul{
	list-style:none;
}
ul li{
	margin-top:20px;
}
.apply-one{
	font-size:18px;
	color:#30B399;
	width:1000px;
	height:30px;
	text-align:center;
	margin:10px auto;
	line-height:30px;
	background-color:#F4F4F4;
}
.apply-two{
		width:800px;
		height:260px;
		margin:20px auto;	
}
.apply-left{
		width:380px;
		height:160px;
		float:left;
		color:#666666;
		font-size:13px;
		margin-left:20px;
}
.apply-right{
		width:380px;
		height:160px;
		float:right;
		color:#666666;
		font-size:13px;
		margin-right:-50px;
}
.apply-left ul li,.apply-right ul li{
		margin-top:20px;
}
.gw-operate{
		width:210px;
		height:30px;
		margin:auto;
		margin-top:25px;
}
.return{
	    width: 60px;
   	 	height: 25px;
		color:white;
		border:none;
		cursor: pointer;
}
.getup{
		width: 80px;
   	 	height: 25px;
		color:white;
		border:none;
		margin-left:60px;
		cursor: pointer;
}
.icon-apply-fanhui{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/fanhui.png') no-repeat 5% 50%;
		background-color:#EA961F;
}
.icon-apply-getup{
		padding-left: 20px;
		background:url('static/easyui/themes/icons/getup.png') no-repeat 5% 50%;
		background-color:#13826B;
}
#countstatue,#feiyong{
		margin-left:12px;
}
.starttime,.endtime{
		width:240px;	
}
</style>
<script type="text/javascript">
	$(function(){
		//点击返回按钮
		$("#count-return").click(function(){
			add("recruitcount");
		});		
		//新增界面中提交申请
		$("#count-getup").click(function(){
			//申请名称
			var rapplyname = $("#name").val();
			//招聘人数
			var rapplynums = $("#rapplynums").val();
			//审批人
			var Staff_id = $("#Staff_id").val();
			//开始时间
			var rapplystart = $("#rapplystart").val();
			//结束时间
			var rapplyend = $("#rapplyend").val();
			//金额
			var rapplymoney = $("#rapplymoney").val();
			//计划id
			var rplanid = $("#rplanid").val();
			
			if (rapplyname==null || rapplyname=="null" || rapplyname=="") {
				alert("请输入申请名称");
			}else if(rapplynums==null || rapplynums=="null" || rapplynums==""){
				alert("请输入招聘人数");
			}else if(Staff_id==null || Staff_id=="null" || Staff_id==""){
				alert("请输入审批人");
			}else if(rapplystart==null || rapplystart=="null" || rapplystart==""){
				alert("请输入开始时间");
			}else if(rapplyend==null || rapplyend=="null" || rapplyend==""){
				alert("请输入结束时间");
			}else if(rapplymoney==null || rapplymoney=="null" || rapplymoney==""){
				alert("请输入金额");
			}else if(rplanid==null || rplanid=="null" || rplanid==""){
				alert("请输入计划");
			}else {
				$.ajax({
					url:"recruitcounts",
					type:"post",
					data:{
						id:Staff_id,
						rapplynums:rapplynums,
						rplanid:rplanid,
						rapplystart:rapplystart,
						rapplyend:rapplyend,
						rapplymoney:rapplymoney,
						rapplyname:rapplyname
						},
				})   
				//刷新界面
				$("#content-admin").panel('open').panel('refresh','recruitcount');
				$("#countapply").window("close");	
			}		
		})
		//审批人
		$('#postion_name').combogrid({
	        panelWidth:200,
	        url:'select_sousuoKuang',
	        singleSelect:true,
	        idField:'Staff_name',
	        treeField:'Staff_name',
	        columns:[[
	        	{field:'sortable',title:'#',width:35,align:'center'},
	        	{field:'Staff_id',hidden:true},
	            {field:'Staff_name',title:'负责人',width:160,align:'center'}
	        ]],
	        onClickRow:function(rowIndex, rowData){
	    		$("#Staff_id").val(rowData['staff_id']);
	    	}
	    });
		//计划名
		$('#name').combogrid({
	        panelWidth:200,
	        url:'select_ji',
	        singleSelect:true,
	        idField:'rplanname',
	        treeField:'rplanname',
	        columns:[[
	        	{field:'sortable',title:'#',width:35,align:'center'},
	        	{field:'rplanid',hidden:true},
	            {field:'rplanname',title:'计划名',width:160,align:'center'}
	        ]],
	        onClickRow:function(rowIndex, rowData){
	    		$("#rplanid").val(rowData['rplanid']);
	    	}
	    });
	});
	function add(text){  
		$("#content-admin").panel({
			href:text
		})
	}
</script>
	<div id="countapply" class="applys" style="height:500px;margin:auto;border:none;">
		<div class="apply-one">
			<span id="sq">新增招聘申请</span>
		</div>
		<div class="apply-two">
		<input type="hidden" id="rplanid">
		<input type="hidden" id="Staff_id">
			<div class="apply-left">
				<ul>
					<li><span>计划名：</span><input type="text" id="name" style="height: 22px;width: 240px;margin-left: -3px;"></li>
					<li><span>审批人：</span><input style="height: 22px;width: 240px;margin-left: -3px;" id="postion_name"></li>
					<li><span id="feiyong">费用：</span><input id="rapplymoney" type="text" style="width:240px;"></li>
				</ul>
			</div>
			<div class="apply-right">
				<ul>
					<li><span>招聘人数：</span><input id="rapplynums" type="text" style="width:240px;">人</li>
					<li><span>开始时间：</span><input id="rapplystart" type="text" class="starttime easyui-datebox" required="required"></li>
					<li><span>结束时间：</span><input id="rapplyend" type="text" class="endtime easyui-datebox" required="required"></li>
				</ul>
			  </div>
			 </div>
			<div class="gw-operate">
				<button id="count-return" class="return icon-apply-fanhui">返回</button>
				<button id="count-getup" class="getup icon-apply-getup">提请审批</button>
			</div>
		</div>	
</body>
</html>